package com.cn.boot.student.entity;

import com.cn.boot.student.vo.PageParams;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.web.multipart.MultipartFile;

import javax.persistence.*;

@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Table(name = "permission", schema = "stu_manage_sys", catalog = "")
public class PermissionEntity extends PageParams implements GrantedAuthority{
    private Integer id;
    private Integer pid;
    private String name;
    private String value;
    private String icon;
    private Integer type;
    private String uri;
    private Integer status;
    private String createTime;
    private Integer sort;
    private Integer isDel;
    private MultipartFile file;

    /**
     * value 为权限的唯一标识
     * @return
     */
    @Override
    public String getAuthority() {
        return this.value;
    }
}
